package com.qdc.datacenters.client;

import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Query;
import com.dtflys.forest.annotation.Retry;
import com.qdc.datacenters.domain.vo.qw.CorpTokenVo;
import com.qdc.datacenters.handler.QwCommonRetryWhenHandler;
import com.qdc.datacenters.interceptor.forest.NotTokenInterceptor;

/**
 * @author danmo
 * @date 2024-03-01 15:20
 **/
@BaseRequest(baseURL = "${qwServerUrl}")
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = QwCommonRetryWhenHandler.class)
public interface CorpTokenClient {
    /**
     * 获取企业凭证
     *
     * @param corpId 企业ID
     * @param scret  企业ID
     * @return CorpTokenVo
     */
    @Get(url = "/gettoken", interceptor = NotTokenInterceptor.class)
    CorpTokenVo getToken(@Query("corpid") String corpId, @Query("corpsecret") String scret);
}
